﻿using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PanhuaWin.通用
{
    public partial class Form存货档案 : UIForm

    {
        public   T_VIEW_CIM 存货档案;
        public string 存货分类;

        public Form存货档案()
        {
            InitializeComponent();
        }

        private void uiSplitContainer1_SplitterMoved(object sender, SplitterEventArgs e)
        {

        }

        private void uiLabel1_Click(object sender, EventArgs e)
        {

        }

        private void uiTextBox条件_TextChanged(object sender, EventArgs e)
        {
            pub.ListInventory(this.uiTextBox条件.Text, 存货分类, this.uiDataGridViewInventory);
        }

        private void uiButton查询_Click(object sender, EventArgs e)
        {
            pub.ListInventory(this.uiTextBox条件.Text, 存货分类,this.uiDataGridViewInventory);
        }

        private void Form存货档案_Load(object sender, EventArgs e)
        {
            pub.ListInventoryClass(this.uiDataGridViewInventoryClass, 存货分类);
        }

        private void uiDataGridViewInventory_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {   if (e.RowIndex>=0)
            {
                string 存货编号 = this.uiDataGridViewInventory.Rows[e.RowIndex].Cells["D存货编号"].Value.ToString();
                存货档案 = pub.getT_VIEW_CIMByT_GOOD_CODE(存货编号);
                if (存货档案 != null)
                {
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
                else
                {
                    this.DialogResult = DialogResult.Cancel;
                }
            }
           
        }

        private void uiDataGridViewInventoryClass_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >=0)
            {
                存货分类 = this.uiDataGridViewInventoryClass.Rows[e.RowIndex].Cells["C存货分类编号"].Value.ToString();
                pub.ListInventory(this.uiTextBox条件.Text, 存货分类, this.uiDataGridViewInventory);
            }
          
        }
    }
}
